defmodule Giom.Repo.Migrations.CreatePoints do
  use Ecto.Migration

  def change do
    create table(:points,primary_key: false) do
		add :branch_code, :string
		add :mgmt_code, :string
		add :point_code, :string, primary_key: true
		add :point_name, :string
		add :type, :string

		add :group_code,  :string
		add :group_code2, :string
		add :group_code3, :string

		add :expiry_date, :utc_datetime
		add :create_date, :utc_datetime
		add :edit_date, :utc_datetime
		
		add :creator, :string
		add :editor, :string

      timestamps()
    end
	create unique_index(:points, [:point_code])
  end
end
